<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <meta name="robots" content="noindex" />
  <link rel="icon" type="image/png" href="./images/icon-128.png" sizes="128x128">
  <title>xBrowserSync API</title>
</head>

<body id="home" class="index">
  <div class="background">
    <div class="background-img"></div>
  </div>

  <button type="button" class="nav-menu-button">
    <span class="hamburger" aria-hidden="true"></span>
    <span class="sr-only">Menu</span>
  </button>

  <nav id="mainNav" class="navbar navbar-expand-md navbar-default navbar-fixed-top navbar-custom affix">
    <div class="container">
      <div class="collapse navbar-collapse" id="navbar">
        <ul class="navbar-nav">
          <li class="nav-item">
            <a class="nav-link" href="#home">Home</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#status">Status</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#bookmarks">Bookmarks</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#serviceinfo">Service Information</a>
          </li>
        </ul>
      </div>
    </div>
  </nav>

  <header>
    <div class="container">
      <div class="row">
        <div class="col-md-4 offset-md-2">
          <h1>xBrowserSync</h1>
        </div>
        <div class="title col-md-6">
          <h2>API service info</h2>
        </div>
      </div>
    </div>
  </header>

  <section id="status" class="dark">
    <div class="container">
      <div class="row">
        <div class="col-lg-8 offset-lg-2 serviceinfo offline">
          <div class="status">
            <span>
              <strong>Status:</strong>
              <span id="currentstatus"></span>
            </span>
            <span id="location">
              <strong>Location:</strong>
              <span></span>
            </span>
            <span class="version">
              <strong>Version:</strong>
              <span id="version"></span>
            </span>
          </div>
          <div id="servermessage"></div>
        </div>
      </div>
      <div class="row">
        <div class="col-lg-8 offset-lg-2">
          <p>This xBrowserSync service provides a REST API that xBrowserSync clients can sync to. The available API
            methods
            are listed below.</p>
          <p>For more information visit the
            <a href="https://www.xbrowsersync.org/">xBrowserSync website</a> or check out the
            <a href="https://github.com/xbrowsersync/api">API GitHub repo</a>.
          </p>
        </div>
      </div>
    </div>
  </section>

  <section id="bookmarks">
    <div class="container">
      <div class="panel">
        <h3>Bookmarks</h3>
        <div class="header">
          <h4>Create bookmarks</h4>
          <div>
            <span class="label label-warning">Post</span>
            <code>/bookmarks</code>
          </div>
        </div>
        <p>Creates a new (empty) bookmark sync and returns the corresponding ID.</p>
        <div class="example">
          <p>Post body example:</p>
          <pre><code>{
    "version":"1.0.0"
}</code></pre>
          <ul>
            <li>
              <strong>version:</strong> Version number of the xBrowserSync client used to create the sync.
            </li>
          </ul>
          <p>Response example:</p>
          <pre><code>{
    "id":"52758cb942814faa9ab255208025ae59",
    "lastUpdated":"2016-07-06T12:43:16.866Z",
    "version":"1.0.0"
}</code></pre>
          <ul>
            <li>
              <strong>id:</strong> 32 character alphanumeric sync ID.
            </li>
            <li>
              <strong>lastUpdated:</strong> Last updated timestamp for created bookmarks.
            </li>
            <li>
              <strong>version:</strong>Version number of the xBrowserSync client used to create the sync.
            </li>
          </ul>
        </div>

        <div class="header">
          <h4>Get bookmarks</h4>
          <div>
            <span class="label label-success">Get</span>
            <code>/bookmarks/{id}</code>
          </div>
        </div>
        <p>Retrieves the bookmark sync corresponding to the provided sync ID.</p>
        <div class="example">
          <p>Query params:</p>
          <ul>
            <li>
              <strong>id:</strong> 32 character alphanumeric sync ID.
            </li>
          </ul>
          <p>Response example:</p>
          <pre><code>{
    "bookmarks":"DWCx6wR9ggPqPRrhU4O4oLN5P09oULX4Xt+ckxswtFNds...",
    "lastUpdated":"2016-07-06T12:43:16.866Z",
    "version":"1.0.0"
}</code></pre>
          <ul>
            <li>
              <strong>bookmarks:</strong> Encrypted bookmark data salted using secret value.
            </li>
            <li>
              <strong>lastUpdated:</strong> Last updated timestamp for retrieved bookmarks.
            </li>
            <li>
              <strong>version:</strong> Version number of the xBrowserSync client used to create the sync.
            </li>
          </ul>
        </div>

        <div class="header">
          <h4>Update bookmarks</h4>
          <div>
            <span class="label label-info">Put</span>
            <code>/bookmarks/{id}</code>
          </div>
        </div>
        <p>Updates the bookmark sync data corresponding to the provided sync ID with the provided encrypted bookmarks
          data.</p>
        <div class="example">
          <p>Query params:</p>
          <ul>
            <li>
              <strong>id:</strong> 32 character alphanumeric sync ID.
            </li>
          </ul>
          <p>Post body example:</p>
          <pre><code>{
    "bookmarks":"DWCx6wR9ggPqPRrhU4O4oLN5P09oULX4Xt+ckxswtFNds...",
    "lastUpdated":"2016-07-06T12:43:16.866Z",
}</code></pre>
          <ul>
            <li>
              <strong>bookmarks:</strong> Encrypted bookmark data salted using secret value.
            </li>
            <li>
              <strong>lastUpdated:</strong> Last updated timestamp to check against existing bookmarks.
            </li>
          </ul>
          <p>Response example:</p>
          <pre><code>{
    "lastUpdated":"2016-07-06T12:43:16.866Z"
}</code></pre>
          <ul>
            <li>
              <strong>lastUpdated:</strong> Last updated timestamp for updated bookmarks.
            </li>
          </ul>
        </div>

        <div class="header">
          <h4>Get last updated</h4>
          <div>
            <span class="label label-success">Get</span>
            <code>/bookmarks/{id}/lastUpdated</code>
          </div>
        </div>
        <p>Retrieves the bookmark sync last updated timestamp corresponding to the provided sync ID.</p>
        <div class="example">
          <p>Query params:</p>
          <ul>
            <li>
              <strong>id:</strong> 32 character alphanumeric sync ID.
            </li>
          </ul>
          <p>Response example:</p>
          <pre><code>{
    "lastUpdated":"2016-07-06T12:43:16.866Z"
}</code></pre>
          <ul>
            <li>
              <strong>lastUpdated:</strong> Last updated timestamp for corresponding bookmarks.
            </li>
          </ul>
        </div>

        <div class="header">
          <h4>Get sync version</h4>
          <div>
            <span class="label label-success">Get</span>
            <code>/bookmarks/{id}/version</code>
          </div>
        </div>
        <p>Retrieves the bookmark sync version number of the xBrowserSync client used to create the bookmarks sync
          corresponding
          to the provided sync ID.</p>
        <div class="example">
          <p>Query params:</p>
          <ul>
            <li>
              <strong>id:</strong> 32 character alphanumeric sync ID.
            </li>
          </ul>
          <p>Response example:</p>
          <pre><code>{
    "version":"1.0.0"
}</code></pre>
          <ul>
            <li>
              <strong>version:</strong> Version number of the xBrowserSync client used to create the sync.
            </li>
          </ul>
        </div>

      </div>
    </div>
  </section>

  <section id="serviceinfo">
    <div class="container">
      <div class="panel">
        <h3>Service information</h3>
        <div class="header">
          <h4>Get service information</h4>
          <div>
            <span class="label label-success">Get</span>
            <code>/info</code>
          </div>
        </div>
        <p>Retrieves information describing the xBrowserSync service.</p>
        <div class="example">
          <p>Response example:</p>
          <pre><code>{
    "maxSyncSize":204800,
    "message":"",
    "status":1,
    "version":"1.0.0"
}</code></pre>
          <ul>
            <li>
              <strong>status:</strong> Current service status code. 1 = Online; 2 = Offline; 3 = Not accepting new
              syncs.
            </li>
            <li>
              <strong>message:</strong> Service information message.
            </li>
            <li>
              <strong>version:</strong> API version service is using.
            </li>
            <li>
              <strong>maxSyncSize:</strong> Maximum sync size (in bytes) allowed by the service.
            </li>
          </ul>
        </div>
      </div>
    </div>
  </section>
</body>

</html>
